What to you may be atrocities, but to God, the command makes perfect sense.
First, I've already covered elsewhere the incident with Elisha and the she-bear. The scripture is mistranslated and it was not little children who mocked Elisha, but mature teenagers. They knew of Elijah and they had heard that Elijah's mantle had fallen on Elisha. As one scholar put it:
As Elisha left Jericho he undoubtedly enjoyed the accolades of a local hero, but as he proceeded up into the mountains of Ephraim he found no such tribute awaiting him at Bethel. In fact, he was set upon by a mob of mature youths (erroneously called "little children" in our version 5 ) who seem to have heard of Elijah's translation and therefore taunted Elisha saying, "Go up, thou bald head; go up, thou bald head." 6 Dr. Adam Clarke says the significance of this cry might be caught in the words, "Ascend, thou empty skull, to heaven, as it is pretended thy master did."7
Elisha at this time was still a rather young man. 8 He had been living with his parents just seven or eight years before when Elijah first called him and from all appearances was still unmarried. He also had nearly 65 years of active service ahead of him so at the time of this incident he was probably in his prime. The words, "bald head" were often used in the old Hebrew vocabulary to imply leprosy since the disease often caused baldness. It was a term of hatred or derision. 9
5. The word "naar" does not necessarily mean a child but is used to describe Solomon at his accession, when he was at least twenty years old. (Geikie, Hours With the Bible, 4:127, note) Dr. Clarke says the word includes "a young man, a servant, or even a soldier, or one fit to go out to battle: and is so translated in a multitude of places in our common English version." He mentions many examples. See Clarke, Bible Commentary, 2:486.
6. 2 Kings 2:23.
7. Clarke, Bible Commentary, 2:186.
8. Geikie, Hours With the Bible, 4:127.
9. Ibid.
As for the Midianites that Moses ordered slain, by the Lord's command, note that he spared only virgins and that he killed the boys. Why would God do this? Because the Midianites were a horribly wicked culture with sexual depravity intertwined with their religious worship. Boys were drawn into it at an early age and were devoted to it for a number of reasons. They certainly would not constrain themselves, but introduce these pagan rites to the Israelites. The same for the women who had engaged in these ritualistic orgies. Only virgins were safe to bring into the Israelite society. The others would have surely polluted it. Check out verses 8-13:
They also killed Balaam son of Beor with the sword. 9 The Israelites captured the Midianite women and children and took all the Midianite herds, flocks and goods as plunder. 10 They burned all the towns where the Midianites had settled, as well as all their camps. 11 They took all the plunder and spoils, including the people and animals, 12 and brought the captives, spoils and plunder to Moses and Eleazar the priest and the Israelite assembly at their camp on the plains of Moab, by the Jordan across from Jericho.
13 Moses, Eleazar the priest and all the leaders of the community went to meet them outside the camp. 14 Moses was angry with the officers of the army—the commanders of thousands and commanders of hundreds—who returned from the battle.
15 “Have you allowed all the women to live?” he asked them. 16 “They were the ones who followed Balaam’s advice and enticed the Israelites to be unfaithful to the Lord in the Peor incident, so that a plague struck the Lord ’s people.
Balaam, if you'll recall, was a fallen prophet who, when he was forbidden to curse Israel by the Lord, concocted a plan to seduce the men to the Midianite's vulgar worship. And it worked.
So before bashing the Lord, it's best to check out one's facts.